package com.zhuiyun.pm.client.bidding.mapper;

import com.zhuiyun.pm.client.bidding.entity.ClientGoodsEarnestMoney;
import com.zhuiyun.pm.client.bidding.entity.ClientGoodsInfo;
import com.zhuiyun.pm.config.BaseMapper;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClientGoodsInfoMapper extends BaseMapper<ClientGoodsInfo> {


        @Select("select * from client_goods_info where  !(check_status = 5 = transaction_status =1) and seller_id = #{sellerId}")
        List<ClientGoodsInfo> listinfo(@Param("sellerId") Integer sellerId);

        @Select("select * from client_goods_info where check_status = 5 = transaction_status =1 and seller_id = #{sellerId}")
        List<ClientGoodsInfo> listgoods(@Param("sellerId") Integer sellerId);

        @Results({
                @Result(property = "goodsNumber",column = "goods_number"),
                @Result(property = "goodsName",column = "goods_name"),
                @Result(property = "startPrice",column = "start_price"),
                @Result(property = "transactionAddress",column = "transaction_address"),
                @Result(property = "weight",column = "weight"),
                @Result(property = "number",column = "number"),
                @Result(property = "transactionType",column = "transaction_type"),
                @Result(property = "earnestMoney",column = "earnest_money"),
                @Result(property = "imgId",column = "img_id"),
                @Result(property = "transactionStatus",column = "transaction_status"),
                @Result(property = "startTime",column = "start_time"),
                @Result(property = "endTime",column = "end_time"),
                @Result(property = "delayMinutes",column = "delay_minutes"),
                @Result(property = "sellerId",column = "seller_id"),
                @Result(property = "checkStatus",column = "check_status"),
                @Result(property = "createTime",column = "create_time"),
                @Result(property = "updateTime",column = "update_time"),
                @Result(property = "back",column = "back"),
                @Result(property = "delFlag",column = "del_flag"),
                @Result(property = "phone",column = "phone"),
                @Result(property = "contactName",column = "contact_name"),
                @Result(property = "imgViewId",column = "img_view_id")
        })
        @Select("SELECT * FROM client_goods_info where   seller_id = #{sellerId} and goods_name like concat('%', #{goodsName} ,'%')\n")
//                "UNION\n" +
//                "select * from client_goods_info where  seller_id = #{sellerId} and goods_name like concat('%', #{goodsName} ,'%') ")
        List<ClientGoodsInfo> findAll(@Param("sellerId") Integer sellerId,@Param("goodsName") String goodsName);

       
}
